<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'MyJsp.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
	if(confirm(arg))
		$.post(
				"selecthobbybyid",
				{sid:$("[name='sid']").val()},
				function(hob){
					alert(JSON.stringify(hob));
				},
				"json"
			);
		//回显 表单  追加下拉框
		$.ajax({
			url:"doctor?m=getDocById",
			type:"post",
			dataType:"json",
			data:{id:$("[name='id']").val()},
			//asyns:false,取消异步
			success:function(json){
				
				//科室集合
				var list=json.list;
				for(var i in list){
					$("[name='did']").append("<option value='"+list[i].did+"'>"+list[i].dname+"</option>");
				}
				
				//获得doc对象
				var doc=json.doc;
				$("[name='name']").val(doc.name);
				$("[name='pwd']").val(doc.pwd);
				$("[name='datea']").val(doc.datea);
				$("[name='content']").val(doc.content);
				//单选按钮的回显
				$("[name='sex'][value='"+doc.sex+"']").attr("checked",true);
				//复选框的回显
				var h=doc.hobby.split(",");//获得爱好   吃鸡,敲代码  split(",")就是把字符串以,分割  返回数组
				for(var i in h){
					$("[name='hobby'][value='"+h[i]+"']").attr("checked",true);
				}
				
				//下拉列表的回显---当成文本框处理
				$("[name='did']").val(doc.did);
				
			}
		});
	</script>

  </head>
  
  <input name="" value="">
  <input name="" value="">
  <input name="" value="">
  <input name="" value="">
  <body>
  <p style="font-size: 30px;text-align: center;">成员列表</p>
  <span name="sp"></span>
    <table>
    	<tr>
    		<th>姓名</th>
    		<th>性别</th>
    		<th>年龄</th>
    		<th>爱好</th>
    		<th>操作</th>
    	</tr>
    	<tr>
    		<td></td>
    		<td></td>
    		<td></td>
    		<td></td>
    		<td>
    			<button>修改</button>
    			<button>删除</button>
    		</td>
    	</tr>
    </table>
    <in
  </body>
</html>
